IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cms_sp_MediaFileSave]') AND type in (N'P', N'PC'))
	DROP PROCEDURE [dbo].[cms_sp_MediaFileSave]
GO
create procedure [dbo].[cms_sp_MediaFileSave]
(
	@Id int = null,
	@SiteId int = null,
	@SiteGroupId int = null,
	@MimeTypeId int = null,
	@OriginalFileName nvarchar(250),
	@LinkedFileName nvarchar(250),
	@FileSize int,
	@Height int = null,
	@Width int = null,
	@CreatedBy int,
	@DateCreated datetime,
	@LastUpdatedBy int = null,
	@DateLastUpdated datetime = null
)
as
update [dbo].[MediaFiles]
set
	[SiteId] = @SiteId,
	[SiteGroupId] = @SiteGroupId,
	[MimeTypeId] = @MimeTypeId,
	[OriginalFileName] = @OriginalFileName,
	[LinkedFileName] = @LinkedFileName,
	[FileSize] = @FileSize,
	[Height] = @Height,
	[Width] = @Width,
	[CreatedBy] = @CreatedBy,
	[DateCreated] = @DateCreated
where MediaFileId = @Id

GO

